import { request } from "../utils/request";
import type { LoginForm, RegisterForm } from "../types/auth";

// 登录API
export const login = (data: LoginForm) => {
  return request.post("/auth/login", {
    phone: data.account,
    password: data.password,
    nickname: data.nickname || "用户",
  });
};

// 注册API
export const register = (data: RegisterForm) => {
  return request.post("/auth/register", {
    phone: data.account,
    password: data.password,
    nickname: data.nickname || "用户",
  });
};
